<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        html,body{
            margin: 0;
            padding: 0;
        }
        .grid {
            -webkit-column-count: 4;
            -webkit-column-gap: 20px;
            -webkit-column-fill: auto;
            -moz-column-count: 4;
            -moz-column-gap: 20px;
            -moz-column-fill: auto;
            column-count: 4;
            column-gap: 20px;
            column-fill: auto;
        }

        .block {
            background-color: #cfffcf;
            display: block;
            padding: 20px;
            word-wrap: break-word;
            margin-bottom: 20px;
            -webkit-column-break-inside: avoid;
            -moz-column-break-inside: avoid;
            column-break-inside: avoid;
        }

        .one {
            height: 100px;
        }

        .two {
            height: 200px;
        }

        .three {
            height: 300px;
        }
    </style>
</head>

<body>
    <div class="grid">
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block one">height:100px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block one">height:100px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block one">height:100px</div>
        <div class="block one">height:100px</div>
        <div class="block two">height:200px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
        <div class="block three">height:300px</div>
        <div class="block one">height:100px</div>
    </div>
</body>

</html>